﻿// -------------------------------------------------------------------------
//    @FileName         :    NFSnsLoginModule.h
//    @Author           :    gaoyi
//    @Date             :    2025-03-29
//    @Email			:    445267987@qq.com
//    @Module           :    NFSnsLoginModule
//
// -------------------------------------------------------------------------

#pragma once

#include "NFLogicCommon/NFMMODynamicModule.h"

class NFSnsLoginModule : public NFMMODynamicModule
{
public:
    explicit NFSnsLoginModule(NFIPluginManager* p);
    virtual ~NFSnsLoginModule();

    int Awake() override;

    int Tick() override;

    int OnDynamicPlugin() override;

    int OnExecute(uint32_t serverType, uint32_t nEventID, uint32_t bySrcType, uint64_t nSrcID, const google::protobuf::Message* pMessage) override;

public:
    /**
     * @brief 处理客户端消息
     * @param unLinkId
     * @param packet
     * @return
     */
    int OnHandleClientMessage(uint64_t unLinkId, NFDataPackage& packet) override;

    /**
     * @brief 处理来自服务器的信息
     * @param unLinkId
     * @param packet
     * @return
     */
    int OnHandleServerMessage(uint64_t unLinkId, NFDataPackage& packet) override;

public:
    int OnHandleLoginReq(uint64_t unLinkId, NFDataPackage& packet);
    int OnHandleLogoutReq(uint64_t unLinkId, NFDataPackage& packet);
};
